package com.example.lj.uav.view;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.example.lj.uav.R;
import com.example.lj.uav.view.base.BaseActivity;

public class RegisterActivity extends BaseActivity implements View.OnClickListener {
    private View headerView;
    private EditText mEtAccount;
    private TextView mTvLogin;
    private Button mBtnCode;
    private EditText mEtCode;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        initView();
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    private void initView() {
        headerView = findViewById(R.id.login_header);
        TextView mTvHeader = headerView.findViewById(R.id.tv_login_header_text_left);
        TextView mTvTitle = headerView.findViewById(R.id.tv_login_header_title);
        Button mBtn = headerView.findViewById(R.id.btn_login_header_login);
        mTvHeader.setText("登录");
        mTvTitle.setText("注册");
        mBtn.setText("验证");
        mEtAccount = findViewById(R.id.et_register_account);
        mEtCode = findViewById(R.id.et_register_code);
        mTvLogin = findViewById(R.id.tv_register_had_account);
        mBtnCode = findViewById(R.id.btn_register_send_code);
        mTvHeader.setOnClickListener(this);
        mBtn.setOnClickListener(this);
        mTvLogin.setOnClickListener(this);
        mBtnCode.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_login_header_text_left:
                finish();
                break;
            case R.id.btn_login_header_login:
                break;
            case R.id.tv_register_had_account:
                toAct(LoginActivity.class, true);
                this.overridePendingTransition(R.anim.in_left, R.anim.out_right);
                break;
            case R.id.btn_register_send_code:
                break;
        }
    }

    @Override
    public void finish() {
        super.finish();
    }
}
